package com.c.ctgproject.ui.production.material

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import com.c.ctgproject.base.BaseViewModel
import com.c.ctgproject.http.ApiMethods
import com.c.ctgproject.utils.awaitSync
import com.c.ctgproject.utils.handlerBody
import com.c.ctgproject.utils.launch
import com.c.ctgproject.utils.userToken
import java.math.BigDecimal

class MaterialInputWeightViewModel : BaseViewModel() {
    private val mResult = MutableLiveData<String>()
    val result: LiveData<String> get() = mResult


    fun inputMaterialWeight(materialName:String,inWeight:String) {
        launch {
            mResult.value = ApiMethods.getApiService().inputMaterialWeight(
                userToken, handlerBody(
                    "materialName" to materialName,
                    "inWeight" to inWeight
                )
            ).awaitSync()
        }
    }
}